home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 3⁄9⁄90 / 0810-Re[2] Save As PICT-Mar90 < prev    next >
Encoding:
Text File  |  1990-03-09  |  2.1 KB  |  54 lines  |  [TEXT/GEOL]

  1. Item    6204448                         5-March-90        06:34PST
  2.  
  3. From:   ROSENSTEIN1                     Rosenstein, Larry
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.         POWERUP.DEV                     Power Up Software,PRT
  7.  
  8. Sub:    RE>Re- Save As PICT
  9.  
  10. Attn:   MacApp Tech
  11. Attn: Power Up Software,PRT
  12. SentBy: Larry Rosenstein
  13. Date   3/2/90
  14. Subject    RE>Re- Save As PICT
  15. From   Larry Rosenstein
  16. To   MacApp Tech, Power Up Software,PRT
  17.  
  18.          Reply to:   RE>Re- Save As PICT
  19. James,
  20.  
  21. I think the fundamental routine is a view method that accepts a grafPort (or
  22. assumes that the current port is the grafPort) and draws the entire view to
  23. that grafPort.  This would contain the parts of WriteToDeskScrap that put the
  24. view into the port and draw the view.  It would know nothing about pictures.
  25.  
  26. Then you could implement your ViewToPICT method that creates a port, draws the
  27. view within the port, checks for errors, etc.  WriteToDeskScrap would call
  28. this and install the PictHandle into the scrap.  Someone who wanted to do a
  29. simple kind of PICT file would call this and write the picture to the file.
  30. (This routine could be a global utility as you say.)
  31.  
  32. It's not clear to me that TView should have methods to write PICT files
  33. directly to disk.  What I would prefer (and have implemented) is the concept
  34. of a disk-based picture.
  35.  
  36. Imagine a TWritePict class that has a method DoDrawing.  You subclass
  37. TWritePict and override DoDrawing to draw whatever belongs in the picture.
  38. Then to create a PICT file you create an instance of this class and call the
  39. CreateDiskPicture method, passing it a file refnum.  CreateDiskPicture sets up
  40. a private port, and eventually calls DoDrawing.  A subclass that saves views,
  41. would call the method above that draws the view within a given port.
  42.  
  43. (The opposite class is TReadPict that is initialized with a file refnum.  You
  44. call the method DrawDiskPicture instead of DrawPicture to replay the picture
  45. directly from disk.)
  46.  
  47. I prefer this approach because the concept of a disk-based picture stands on
  48. its own, and could be used in other cases.  It doesn't makes sense to tie PICT
  49. files closely to a view.
  50.  
  51. Larry Rosenstein
  52.  
  53.  
  54.